Files in a file server are typically arranged in a hierarchical data structure know as a file system. The file system includes special files known as directories at the top of the data structure, and regular data files residing below the directories. Operating system routines manage the directories, so that application-level programs do not directly access the directories. In contrast, application-level programs directly access the regular data files by reading data from and writing data to the regular data files.
In order to access a file in the file server, a client of the file server first obtain a “file handle,” which is used in subsequent requests to read data from or write data to the file. The client obtains the “file handle” by issuing a series of directory lookup requests to the file server. These directory lookup requests specify a path name for the file down the file system hierarchy.
A directory tree is a subset of a file system. A directory tree includes a root directory, any number of subdirectories depending from the root directory, and any number of regular data files in the root directory and the subdirectories depending from the root directory.
Directory trees are often moved from a source file system to a target file system for load balancing between the file systems, for removal of a storage device for the source file system, or for adding a new storage device for the target file system. The migration process may take considerable time when the directory tree is migrated between file systems in different file servers.
Unless precautions are taken, the migration process is often disruptive to applications that are reading data from or writing data to the regular data files in the directory tree. For example, when a directory tree is moved within a global namespace, the names and paths to the files within the tree can be preserved using techniques such as symbolic links, mount points, and junctions. However, if the tree is moved into a different file system within the global namespace, then the file handles of the files within the tree will change. Any clients that have cached those file handles and try to use them in read or write requests will receive “stale file handle” errors from the file server.